package demo04ProxyPattern.staticProxy;

/**
 * @author: WangPeng
 * @createTime: 2022/11/09 17:04
 * @description:
 * @version: v1.0
 */
//房产中介---代理类 【不但可以调用被代理对象的方法，还可以拥有自己的方法】
public class ZhongJie implements ChuZhu{
    //被代理的对象
    private FangDong target;

    public ZhongJie(FangDong target) {
        this.target = target;
    }

    @Override
    public void chuZhu() {
        introduce();
        watch();
        target.chuZhu();
    }
    public void watch(){
        System.out.println("中介带你看房");
    }
    public void introduce(){
        System.out.println("房屋介绍");
    }
}
